vulkan: Destroy image before releasing associate memory
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 14 Dec 2017 00:43:50 +0000 (22:43 -0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 14 Dec 2017 00:49:16 +0000 (22:49 -0200)
commit147a4551711e5ce762094c13bbdcd8cadf55965a
tree5293e387e7c6618dd3f648a98cec70c5cfaaa935
parent192bdae2803280e0c32c9992bc3a9d6bbccd0dae
vulkan: Destroy image before releasing associate memory

VkImage contains a reference to the VkDeviceMemory and, because
the current code frees the VkDeviceMemory before destroying the
VkImage that references it, a warning is triggered by the validation
layers.

This is not critical, since we release both resources at the same
place. But the warning triggered by the validation layers sums up
adding 1 MB per second of extra debug logging, making the debugging
process much more painful.

This commit simply swaps the destruction order, and destroys the
VkImage first, then the now unused VkDeviceMemory.
gsk/gskvulkanimage.c